package com.yfp.goods.api;

import com.yfp.common.core.constant.ServiceNameConstants;
import com.yfp.common.core.domain.R;
import com.yfp.goods.api.factory.RemoteGoodsFallbackFactory;
import com.yfp.goods.domain.ComboDetailImg;
import com.yfp.goods.domain.Goods;
import com.yfp.goods.domain.GoodsNutritive;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * operation运营模块
 *
 * @author ruoyi
 */
@FeignClient(contextId = "remoteGoodsService", value = ServiceNameConstants.GOODS_SERVICE, fallbackFactory = RemoteGoodsFallbackFactory.class)
public interface RemoteGoodsService {

    @GetMapping("/comboDetailImg/{comboId}")
    R<List<ComboDetailImg>> queryComboDetailImg(@PathVariable("comboId") String comboId);


    @GetMapping("/goodsNutritive/{goodsId}")
    R<List<GoodsNutritive>> queryGoodsNutritiveByGoodsId(@PathVariable("goodsId") String goodsId);

    @GetMapping("/comboDetailImg/getResourceUrl")
    public R<String> getResourceUrl(@RequestParam("resourceType") Integer resourceType,@RequestParam("resourceId") String resourceId);

    @GetMapping("/comboGoods/{comboId}")
    public R<List<Goods>> queryByComboId(@PathVariable("comboId") String comboId);


}